package ExceptionDemo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 阿宾
 * Date: 2025-03-13
 * Time: 21:55
 */
public class Test3 {
    public static void main(String[] args) {

        int[] arr = {1,2,3,4,5};
        try{
            System.out.println(arr[10]);
        }catch (ArrayIndexOutOfBoundsException e){
            //System.out.println("数组越界异常");

            /*String s = e.toString();
            System.out.println(s);

            String s1 = e.getMessage();
            System.out.println(s1);
*/
            e.printStackTrace();
        }
        System.out.println("异常之后的语句");
    }
}
